<div class="page-add-new-article">
    <div id="content-header">
        <h1><?php echo __d('system','Add Config Mail');?></h1>
    </div>

    <div class="container-fluid">

    <div class="row-fluid">
        <div class="span12">
        <?php
            echo $this->Form->create('ConfigMail', array('id' => 'paginate','class'=>'form-horizontal', 'action' => 'edit', 'url' => $this->request->here(false), 'type' => 'file',
                'inputDefaults' => array('label' => false, 'format' => array('before', 'label', 'between', 'input', 'after', 'error'))));

            echo $this->Html->script('ckeditor/ckeditor');
            // echo $this->element('toolbar');
        ?>                                    
        
            <?php   
                $fieldsets['type_mail'] = $this->Form->input('type_mail', array(
                    'label' => array('text'=>__d('system','Type Mail'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group'),
                    'after' => '</div>',                    
                    'default'=>$default,
                    'options'=>array(0=>'Web Mail',1=>'Gmail'),
                    'type' => 'select'));
                $fieldsets['sub_site_id'] = $this->Form->input('sub_site_id', array(
                    'label' => array('text'=>__d('system','Sub Site'),'text'=>'Subsite','class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group'),
                    'after' => '</div>',                    
                    'default'=>0,
                    'options'=>$listSubSite,
                    'type' => 'select')); 
                $fieldsets['timeout'] = $this->Form->input('timeout', array(
                    'label' => array('text'=>__d('system','Timeout'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group change_type_mail'),
                    'after' => '</div>',                    
                    'default'=>30,
                    'type' => 'text'));                                                                                                            
                $fieldsets['host'] = $this->Form->input('host', array(
                    'label' => array('text'=>__d('system','Host'),'class' => 'control-label'),
                    'default'=>'ssl://smtp.gmail.com',
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group change_type_mail'),
                    'after' => '</div>',
                    'type' => 'text'));  
                $fieldsets['port'] = $this->Form->input('port', array(
                    'label' => array('text'=>__d('system','Port'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'default'=>465,
                    'div' => array('class' => 'control-group change_type_mail'),
                    'after' => '</div>',
                    'type' => 'text'));  
                $fieldsets['username'] = $this->Form->input('username', array(
                    'label' => array('text'=>__d('system','User Name'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group change_type_mail'),
                    'after' => '</div>',
                    'type' => 'text'));  
                $fieldsets['password'] = $this->Form->input('password', array(
                    'label' => array('text'=>__d('system','Password'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group change_type_mail'),
                    'after' => '</div>',
                    'type' => 'password'));
                $fieldsets['client'] = $this->Form->input('client', array(
                    'label' => array('text'=>__d('system','Client'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group'),
                    'after' => '</div>',
                    'default'=>'yoursite',
                    'type' => 'text'));                           
                $fieldsets['sendAs'] = $this->Form->input('sendAs', array(
                    'label' => array('text'=>__d('system','sendAs'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group'),
                    'default'=>'html',
                    'after' => '</div>',
                    'type' => 'text')); 
                $fieldsets['delivery'] = $this->Form->input('delivery', array(
                    'label' => array('text'=>__d('system','Delivery'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group change_type_mail'),
                    'after' => '</div>',
                    'default'=>'smtp',
                    'type' => 'text')); 
                $fieldsets['from'] = $this->Form->input('from', array(
                    'label' => array('text'=>__d('system','From'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group'),
                    'after' => '</div>',
                    'default'=>'[DHNN] <info@bvtamtridanang.com>',
                    'type' => 'text'));                 
                $fieldsets['to'] = $this->Form->input('to', array(
                    'label' => array('text'=>__d('system','To'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group'),
                    'after' => '</div>',                
                    'type' => 'text'));
                $fieldsets['subject'] = $this->Form->input('subject', array(
                    'label' => array('text'=>__d('system','Subject'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'div' => array('class' => 'control-group'),
                    'after' => '</div>',
                    'default'=>'[mo ta chu de]',
                    'type' => 'text')); 
                $fieldsets['prefix'] = $this->Form->input('prefix', array(
                    'label' => array('text'=>__d('system','Prefix'),'class' => 'control-label'),
                    'between' => '<div class="controls">',
                    'default'=>'[DHNN]',
                    'div' => array('class' => 'control-group'),
                    'after' => '</div>',
                    'type' => 'text')); 

            ?>
            <?php           
                $layout = array(
                    array('type_mail','timeout'),
                    array('sub_site_id'),
                    array('host','port'),
                    array('username','password'),
                    array('client','sendAs'),
                    array('delivery','from'),
                    array('to','subject'),
                    array('prefix')               
                );
                $layout = array(
                    array(
                        'Basic setting',
                        $layout,
                    )
                );
                echo $this->Layout->form($layout, $fieldsets);
            ?>        
        <div class="form-actions form-actions-two">
            <?php  echo $this->element('toolbar');?>
        </div>  
        <?php
            echo $this->Form->hidden('node_type_id');
            echo $this->Form->hidden('Paginate.task', array('id' => 'task', 'value' => ''));
            echo $this->Form->end();
        ?>                                    
    </div>    
</div>

